#include<stdio.h>
#include"SeqString.h"
int main()
{
    freopen("in.txt","r",stdin);
    char s1[] = "Icomefromxian";
    char s2[] = "fromzhengzhou";
    SeqString str1;
    SeqString str2;
    int mlength = 0;
    int p = 0;
    StrAssign(&str1,s1);
    StrAssign(&str2,s2);
    int i = 0;
    while(i < str1.length)
    {
        int j = 0;
        int flag = 0;
        int length = 0;
        while (j < str2.length)
        {
            if(str1.str[i] == str2.str[j])
            {
                flag = 1;
                int k = 1;
                length = 1;
                while(flag)
                {
                    if(i + k < str1.length && j+k < str2.length && str1.str[i+k] == str2.str[j+k])
                    {
                        flag = 1;
                        k++;
                        length = k;
                    }
                    else
                    {
                        flag = 0;
                    }
                }
                if(length > mlength)
                {
                    mlength = length;
                    p = i;
                    //printf("%c",s1[p]);
                }
                j+=k;
            }
            else
                j++;
        }
        i++;
    }
    s1[p + mlength] = '\0';
    printf("%s",s1+p);
}